/**
* 基础菜单 商品管理
*/
<template>
  <div>

    <!-- 面包屑导航 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>新闻栏目</el-breadcrumb-item>
    </el-breadcrumb>

    <news-item-category-list v-on:onRowEditClick="onRowEditClick"
                        @setMainLoadingFalse="isMainListLoading=false"
                        :isMainListLoading.sync="isMainListLoading"></news-item-category-list>



  <news-item-category-edit :dialogVisible="editFormVisible"
                      :rowData="editForm"
                      @onDialogClose="onEditDialogClosed"
  ></news-item-category-edit>


  </div>
</template>

<script>
    import NewsItemCategoryEdit from "./NewsItemCategoryEdit";
    import NewsItemCategoryList from "./NewsItemCategoryList"
    export default {
        components: {
            NewsItemCategoryEdit,
            NewsItemCategoryList
        },
        data() {
            return {
                isMainListLoading: false, //是显示加载
                editFormVisible: false, //控制编辑页面显示与隐藏
                title: '添加',
                editForm: Object,
            }
        },
        methods: {
            //显示编辑界面
            onRowEditClick: function(row) {
                if (row!=null && row != undefined) {
                    this.editForm = row;
                } else {
                    this.editForm = {};
                }
                this.editFormVisible = true;
            },
            onEditDialogClosed:function(saveOrNot){
              this.editFormVisible = false;
              if(saveOrNot){
                  this.isMainListLoading = true;
              }
            }
        }
    }
</script>

